3.253 \(\int (a+b \tan ^2(c+d x)) \, dx\)

Optimal. Leaf size=19 \[ a x+\frac {b \tan (c+d x)}{d}-b x \]

[Out]

a*x-b*x+b*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3473, 8} \[ a x+\frac {b \tan (c+d x)}{d}-b x \]

Antiderivative was successfully verified.

[In]

Int[a + b*Tan[c + d*x]^2,x]

[Out]

a*x - b*x + (b*Tan[c + d*x])/d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rubi steps

\begin {align*} \int \left (a+b \tan ^2(c+d x)\right ) \, dx &=a x+b \int \tan ^2(c+d x) \, dx\\ &=a x+\frac {b \tan (c+d x)}{d}-b \int 1 \, dx\\ &=a x-b x+\frac {b \tan (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 28, normalized size = 1.47 \[ a x-\frac {b \tan ^{-1}(\tan (c+d x))}{d}+\frac {b \tan (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[a + b*Tan[c + d*x]^2,x]

[Out]

a*x - (b*ArcTan[Tan[c + d*x]])/d + (b*Tan[c + d*x])/d

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 21, normalized size = 1.11 \[ \frac {{\left (a - b\right )} d x + b \tan \left (d x + c\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(d*x+c)^2,x, algorithm="fricas")

[Out]

((a - b)*d*x + b*tan(d*x + c))/d

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(d*x+c)^2,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check si
gn: (2*pi/x/2)>(-2*pi/x/2)b*(-4*d*x*tan(c)*tan(d*x)+4*d*x-pi*sign(2*tan(c)^2*tan(d*x)+2*tan(c)*tan(d*x)^2-2*ta
n(c)-2*tan(d*x))*tan(c)*tan(d*x)+pi*sign(2*tan(c)^2*tan(d*x)+2*tan(c)*tan(d*x)^2-2*tan(c)-2*tan(d*x))-pi*tan(c
)*tan(d*x)+pi+2*atan((tan(c)*tan(d*x)-1)/(tan(c)+tan(d*x)))*tan(c)*tan(d*x)-2*atan((tan(c)*tan(d*x)-1)/(tan(c)
+tan(d*x)))+2*atan((tan(c)+tan(d*x))/(tan(c)*tan(d*x)-1))*tan(c)*tan(d*x)-2*atan((tan(c)+tan(d*x))/(tan(c)*tan
(d*x)-1))-4*tan(c)-4*tan(d*x))/(4*d*tan(c)*tan(d*x)-4*d)+a*x

________________________________________________________________________________________

maple [A]  time = 0.03, size = 29, normalized size = 1.53 \[ a x +\frac {b \tan \left (d x +c \right )}{d}-\frac {b \arctan \left (\tan \left (d x +c \right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a+b*tan(d*x+c)^2,x)

[Out]

a*x+b*tan(d*x+c)/d-1/d*b*arctan(tan(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.82, size = 23, normalized size = 1.21 \[ a x - \frac {{\left (d x + c - \tan \left (d x + c\right )\right )} b}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(d*x+c)^2,x, algorithm="maxima")

[Out]

a*x - (d*x + c - tan(d*x + c))*b/d

________________________________________________________________________________________

mupad [B]  time = 11.44, size = 21, normalized size = 1.11 \[ \frac {b\,\mathrm {tan}\left (c+d\,x\right )+d\,x\,\left (a-b\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a + b*tan(c + d*x)^2,x)

[Out]

(b*tan(c + d*x) + d*x*(a - b))/d

________________________________________________________________________________________

sympy [A]  time = 0.14, size = 20, normalized size = 1.05 \[ a x + b \left (\begin {cases} - x + \frac {\tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \tan ^{2}{\relax (c )} & \text {otherwise} \end {cases}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(d*x+c)**2,x)

[Out]

a*x + b*Piecewise((-x + tan(c + d*x)/d, Ne(d, 0)), (x*tan(c)**2, True))

________________________________________________________________________________________